<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>perlform - Perl formats - Perldoc Browser</title>
    <link rel="search" href="https://perldoc.perl.org/opensearch.xml" type="application/opensearchdescription+xml" title="Perldoc Browser">
    <link rel="canonical" href="https://perldoc.perl.org/perlform">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/stackoverflow-light.min.css" integrity="sha512-cG1IdFxqipi3gqLmksLtuk13C+hBa57a6zpWxMeoY3Q9O6ooFxq50DayCdm0QrDgZjMUn23z/0PMZlgft7Yp5Q==" crossorigin="anonymous" />
    <style>
      body {
        background: #f4f4f5;
        color: #020202;
      }
      .navbar-dark {
        background-image: -webkit-linear-gradient(top, #005f85 0, #002e49 100%);
        background-image: -o-linear-gradient(top, #005f85 0, #002e49 100%);
        background-image: linear-gradient(to bottom, #005f85 0, #002e49 100%);
        filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff005f85', endColorstr='#ff002e49', GradientType=0);
        background-repeat: repeat-x;
      }
      .navbar-dark .navbar-nav .nav-link,
      .navbar-dark .navbar-nav .nav-link:focus { color: #fff }
      .navbar-dark .navbar-nav .nav-link:hover { color: #ffef68 }
      #wrapperlicious {
        margin: 0 auto;
        font: 0.9em 'Helvetica Neue', Helvetica, sans-serif;
        font-weight: normal;
        line-height: 1.5em;
        margin: 0;
        padding: 0;
      }
      #wrapperlicious h1 { font-size: 1.5em }
      #wrapperlicious h2 { font-size: 1.3em }
      #wrapperlicious h3 { font-size: 1.1em }
      #wrapperlicious h4 { font-size: 0.9em }
      #wrapperlicious h1, #wrapperlicious h2, #wrapperlicious h3,
      #wrapperlicious h4, #wrapperlicious dt {
        color: #020202;
        margin-top: 1em;
        margin-bottom: 1em;
        position: relative;
        font-weight: bold;
      }
      #wrapperlicious a { color: inherit; text-decoration: underline }
      #wrapperlicious #toc { text-decoration: none }
      #wrapperlicious a:hover { color: #2a2a2a }
      #wrapperlicious a img { border: 0 }
      #wrapperlicious :not(pre) > code {
        color: inherit;
        background-color: rgba(0, 0, 0, 0.04);
        border-radius: 3px;
        font: 0.9em Consolas, Menlo, Monaco, monospace;
        padding: 0.3em;
      }
      #wrapperlicious dd {
        margin: 0;
        margin-left: 2em;
      }
      #wrapperlicious dt {
        color: #2a2a2a;
        font-weight: bold;
        margin-left: 0.9em;
      }
      #wrapperlicious p {
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious li > p {
        margin-bottom: 0;
        margin-top: 0;
      }
      #wrapperlicious pre {
        border: 1px solid #c1c1c1;
        border-radius: 3px;
        font: 100% Consolas, Menlo, Monaco, monospace;
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious pre > code {
        display: block;
        background-color: #f6f6f6;
        font: 0.9em Consolas, Menlo, Monaco, monospace;
        line-height: 1.5em;
        text-align: left;
        white-space: pre;
        padding: 1em;
      }
      #wrapperlicious dl, #wrapperlicious ol, #wrapperlicious ul {
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious ul {
        list-style-type: square;
      }
      #wrapperlicious ul ul {
        margin-bottom: 0px;
        margin-top: 0px;
      }
      #footer {
        font-size: 0.8em;
        padding-top: 0.5em;
        text-align: center;
      }
      #more {
        display: inline;
        font-size: 0.8em;
      }
      #perldocdiv {
        background-color: #fff;
        border: 1px solid #c1c1c1;
        border-bottom-left-radius: 5px;
        border-bottom-right-radius: 5px;
        margin-left: auto;
        margin-right: auto;
        padding: 3em;
        padding-top: 1em;
        max-width: 960px;
      }
      #moduleversion { float: right }
      #wrapperlicious .leading-notice {
        font-style: italic;
        padding-left: 1em;
        margin-top: 1em;
        margin-bottom: 1em;
      }
      #wrapperlicious .permalink {
        display: none;
        left: -0.75em;
        position: absolute;
        padding-right: 0.25em;
        text-decoration: none;
      }
      #wrapperlicious h1:hover .permalink, #wrapperlicious h2:hover .permalink,
      #wrapperlicious h3:hover .permalink, #wrapperlicious h4:hover .permalink,
      #wrapperlicious dt:hover .permalink {
        display: block;
      }
    </style>
    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-KVNWBNT5FB"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', 'G-KVNWBNT5FB');
      gtag('config', 'UA-50555-3');
    </script>
  </head>
  <body>
    <nav class="navbar navbar-expand-md navbar-dark bg-dark justify-content-between">
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <a class="navbar-brand" href="https://perldoc.perl.org/">Perldoc Browser</a>
  <div class="collapse navbar-collapse" id="navbarNav">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="perlform.html#" id="dropdownlink-stable" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">5.35.0</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-stable">
          <a class="dropdown-item" href="https://perldoc.perl.org/perlform">Latest</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.2/perlform">5.38.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.1/perlform">5.38.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0/perlform">5.38.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.3/perlform">5.36.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.2/perlform">5.36.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.1/perlform">5.36.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.0/perlform">5.36.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.3/perlform">5.34.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.2/perlform">5.34.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.1/perlform">5.34.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.0/perlform">5.34.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.32.1/perlform">5.32.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.32.0/perlform">5.32.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.3/perlform">5.30.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.2/perlform">5.30.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.1/perlform">5.30.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.0/perlform">5.30.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.3/perlform">5.28.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.2/perlform">5.28.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.1/perlform">5.28.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.0/perlform">5.28.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.3/perlform">5.26.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.2/perlform">5.26.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.1/perlform">5.26.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.0/perlform">5.26.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.4/perlform">5.24.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.3/perlform">5.24.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.2/perlform">5.24.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.1/perlform">5.24.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.0/perlform">5.24.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.4/perlform">5.22.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.3/perlform">5.22.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.2/perlform">5.22.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.1/perlform">5.22.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.0/perlform">5.22.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.3/perlform">5.20.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.2/perlform">5.20.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.1/perlform">5.20.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.0/perlform">5.20.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.4/perlform">5.18.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.3/perlform">5.18.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.2/perlform">5.18.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.1/perlform">5.18.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.0/perlform">5.18.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.3/perlform">5.16.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.2/perlform">5.16.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.1/perlform">5.16.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.0/perlform">5.16.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.4/perlform">5.14.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.3/perlform">5.14.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.2/perlform">5.14.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.1/perlform">5.14.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.0/perlform">5.14.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.5/perlform">5.12.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.4/perlform">5.12.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.3/perlform">5.12.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.2/perlform">5.12.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.1/perlform">5.12.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.0/perlform">5.12.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.10.1/perlform">5.10.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.10.0/perlform">5.10.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.9/perlform">5.8.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.8/perlform">5.8.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.7/perlform">5.8.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.6/perlform">5.8.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.5/perlform">5.8.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.4/perlform">5.8.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.3/perlform">5.8.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.2/perlform">5.8.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.1/perlform">5.8.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.0/perlform">5.8.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.2/perlform">5.6.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.1/perlform">5.6.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.0/perlform">5.6.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_04/perlform">5.005_04</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_03/perlform">5.005_03</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_02/perlform">5.005_02</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_01/perlform">5.005_01</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005/perlform">5.005</a>
        </div>
      </li>
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="perlform.html#" id="dropdownlink-dev" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dev</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-dev">
          <a class="dropdown-item" href="https://perldoc.perl.org/blead/perlform">blead</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.6/perlform">5.39.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.5/perlform">5.39.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.4/perlform">5.39.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.3/perlform">5.39.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.2/perlform">5.39.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.1/perlform">5.39.1</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0-RC2/perlform">5.38.0-RC2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0-RC1/perlform">5.38.0-RC1</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.11/perlform">5.37.11</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.10/perlform">5.37.10</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.9/perlform">5.37.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.8/perlform">5.37.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.7/perlform">5.37.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.6/perlform">5.37.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.5/perlform">5.37.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.4/perlform">5.37.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.3/perlform">5.37.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.2/perlform">5.37.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.1/perlform">5.37.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.0/perlform">5.37.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.11/perlform">5.35.11</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.10/perlform">5.35.10</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.9/perlform">5.35.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.8/perlform">5.35.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.7/perlform">5.35.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.6/perlform">5.35.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.5/perlform">5.35.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.4/perlform">5.35.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.3/perlform">5.35.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.2/perlform">5.35.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.1/perlform">5.35.1</a>
          <a class="dropdown-item active" href="perlform.html">5.35.0</a>
        </div>
      </li>
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="perlform.html#" id="dropdownlink-nav" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Documentation</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-nav">
          <a class="dropdown-item" href="perl.html">Perl</a>
          <a class="dropdown-item" href="perlintro.html">Intro</a>
          <a class="dropdown-item" href="perl.html#Tutorials">Tutorials</a>
          <a class="dropdown-item" href="perlfaq.html">FAQs</a>
          <a class="dropdown-item" href="perl.html#Reference-Manual">Reference</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="perlop.html">Operators</a>
          <a class="dropdown-item" href="functions.html">Functions</a>
          <a class="dropdown-item" href="variables.html">Variables</a>
          <a class="dropdown-item" href="modules.html">Modules</a>
          <a class="dropdown-item" href="perlutil.html">Utilities</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="perlcommunity.html">Community</a>
          <a class="dropdown-item" href="perlhist.html">History</a>
        </div>
      </li>
    </ul>
    <ul class="navbar-nav">
      <script>
        function set_expand (expand) {
          var perldocdiv = document.getElementById('perldocdiv');
          var width = window.getComputedStyle(perldocdiv).getPropertyValue('max-width');
          var expanded = (width == '' || width == 'none') ? true : false;
          if (expand === null) {
            expand = !expanded;
          }
          if ((expand && !expanded) || (!expand && expanded)) {
            perldocdiv.style.setProperty('max-width', expand ? 'none' : '960px');
            var button_classlist = document.getElementById('content-expand-button').classList;
            if (expand) {
              button_classlist.add('btn-light');
              button_classlist.remove('btn-outline-light');
            } else {
              button_classlist.add('btn-outline-light');
              button_classlist.remove('btn-light');
            }
          }
          return expand;
        }
        function toggle_expand () {
          var expand = set_expand(null);
          document.cookie = 'perldoc_expand=' + (expand ? 1 : 0) + '; path=/; expires=Tue, 19 Jan 2038 03:14:07 UTC';
        }
        function read_expand () {
          return document.cookie.split(';').some(function (item) { return item.indexOf('perldoc_expand=1') >= 0 });
        }
        if (document.readyState === 'loading') {
          document.addEventListener('DOMContentLoaded', function () {
            if (read_expand()) {
              set_expand(true);
            }
          });
        } else if (read_expand()) {
          set_expand(true);
        }
      </script>
      <button id="content-expand-button" type="button" class="btn btn-outline-light d-none d-lg-inline-block mr-2" onclick="toggle_expand()">Expand</button>
    <ul>
    <form class="form-inline" method="get" action="https://perldoc.perl.org/5.35.0/search">
      <input class="form-control mr-3" type="search" name="q" placeholder="Search" aria-label="Search">
    </form>
  </div>
</nav>

    <div id="wrapperlicious" class="container-fluid">
      <div id="perldocdiv">
        <div id="links">
          <a href="perlform.html">perlform</a>
          <div id="more">
            (<a href="perlform.txt">source</a>,
            <a href="https://metacpan.org/pod/perlform">CPAN</a>)
          </div>
        </div>
        <div class="leading-notice">
          You are viewing the version of this documentation from Perl 5.35.0.
            This is a development version of Perl.
        </div>
        <h1><a id="toc">CONTENTS</a></h1>
                  <ul>
              <li>
                <a class="text-decoration-none" href="perlform.html#NAME">NAME   </a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlform.html#DESCRIPTION">DESCRIPTION</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="perlform.html#Text-Fields">Text Fields </a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlform.html#Numeric-Fields">Numeric Fields  </a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlform.html#The-Field-@*-for-Variable-Width-Multi-Line-Text">The Field @* for Variable-Width Multi-Line Text </a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlform.html#The-Field-%5E*-for-Variable-Width-One-line-at-a-time-Text">The Field ^* for Variable-Width One-line-at-a-time Text </a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlform.html#Specifying-Values">Specifying Values </a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlform.html#Using-Fill-Mode">Using Fill Mode </a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlform.html#Suppressing-Lines-Where-All-Fields-Are-Void">Suppressing Lines Where All Fields Are Void </a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlform.html#Repeating-Format-Lines">Repeating Format Lines </a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlform.html#Top-of-Form-Processing">Top of Form Processing   </a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlform.html#Format-Variables">Format Variables  </a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="perlform.html#NOTES">NOTES</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="perlform.html#Footers">Footers  </a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlform.html#Accessing-Formatting-Internals">Accessing Formatting Internals </a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="perlform.html#WARNINGS">WARNINGS</a>
              </li>
          </ul>

      <h1 id="NAME"><a class="permalink" href="perlform.html#NAME">#</a>NAME   </h1>

<p>perlform - Perl formats</p>

<h1 id="DESCRIPTION"><a class="permalink" href="perlform.html#DESCRIPTION">#</a>DESCRIPTION</h1>

<p>Perl has a mechanism to help you generate simple reports and charts. To facilitate this, Perl helps you code up your output page close to how it will look when it&#39;s printed. It can keep track of things like how many lines are on a page, what page you&#39;re on, when to print page headers, etc. Keywords are borrowed from FORTRAN: format() to declare and write() to execute; see their entries in <a href="perlfunc.html">perlfunc</a>. Fortunately, the layout is much more legible, more like BASIC&#39;s PRINT USING statement. Think of it as a poor man&#39;s nroff(1). </p>

<p>Formats, like packages and subroutines, are declared rather than executed, so they may occur at any point in your program. (Usually it&#39;s best to keep them all together though.) They have their own namespace apart from all the other &quot;types&quot; in Perl. This means that if you have a function named &quot;Foo&quot;, it is not the same thing as having a format named &quot;Foo&quot;. However, the default name for the format associated with a given filehandle is the same as the name of the filehandle. Thus, the default format for STDOUT is named &quot;STDOUT&quot;, and the default format for filehandle TEMP is named &quot;TEMP&quot;. They just look the same. They aren&#39;t.</p>

<p>Output record formats are declared as follows:</p>

<pre><code class="plaintext">format NAME =
FORMLIST
.</code></pre>

<p>If the name is omitted, format &quot;STDOUT&quot; is defined. A single &quot;.&quot; in column 1 is used to terminate a format. FORMLIST consists of a sequence of lines, each of which may be one of three types:</p>

<ol>

<li><p>A comment, indicated by putting a &#39;#&#39; in the first column.</p>

</li>
<li><p>A &quot;picture&quot; line giving the format for one output line.</p>

</li>
<li><p>An argument line supplying values to plug into the previous picture line.</p>

</li>
</ol>

<p>Picture lines contain output field definitions, intermingled with literal text. These lines do not undergo any kind of variable interpolation. Field definitions are made up from a set of characters, for starting and extending a field to its desired width. This is the complete set of characters for field definitions:              </p>

<pre><code class="plaintext">@    start of regular field
^    start of special field
&lt;    pad character for left justification
|    pad character for centering
&gt;    pad character for right justification
#    pad character for a right-justified numeric field
0    instead of first #: pad number with leading zeroes
.    decimal point within a numeric field
...  terminate a text field, show &quot;...&quot; as truncation evidence
@*   variable width field for a multi-line value
^*   variable width field for next line of a multi-line value
~    suppress line with all fields empty
~~   repeat line until all fields are exhausted</code></pre>

<p>Each field in a picture line starts with either &quot;@&quot; (at) or &quot;^&quot; (caret), indicating what we&#39;ll call, respectively, a &quot;regular&quot; or &quot;special&quot; field. The choice of pad characters determines whether a field is textual or numeric. The tilde operators are not part of a field. Let&#39;s look at the various possibilities in detail.</p>

<h2 id="Text-Fields"><a class="permalink" href="perlform.html#Text-Fields">#</a><a id="Text"></a>Text Fields </h2>

<p>The length of the field is supplied by padding out the field with multiple &quot;&lt;&quot;, &quot;&gt;&quot;, or &quot;|&quot; characters to specify a non-numeric field with, respectively, left justification, right justification, or centering. For a regular field, the value (up to the first newline) is taken and printed according to the selected justification, truncating excess characters. If you terminate a text field with &quot;...&quot;, three dots will be shown if the value is truncated. A special text field may be used to do rudimentary multi-line text block filling; see <a href="perlform.html#Using-Fill-Mode">&quot;Using Fill Mode&quot;</a> for details.</p>

<pre><code class="plaintext">Example:
   format STDOUT =
   @&lt;&lt;&lt;&lt;&lt;&lt;   @||||||   @&gt;&gt;&gt;&gt;&gt;&gt;
   &quot;left&quot;,   &quot;middle&quot;, &quot;right&quot;
   .
Output:
   left      middle    right</code></pre>

<h2 id="Numeric-Fields"><a class="permalink" href="perlform.html#Numeric-Fields">#</a><a id="Numeric"></a>Numeric Fields  </h2>

<p>Using &quot;#&quot; as a padding character specifies a numeric field, with right justification. An optional &quot;.&quot; defines the position of the decimal point. With a &quot;0&quot; (zero) instead of the first &quot;#&quot;, the formatted number will be padded with leading zeroes if necessary. A special numeric field is blanked out if the value is undefined. If the resulting value would exceed the width specified the field is filled with &quot;#&quot; as overflow evidence.</p>

<pre><code class="plaintext">Example:
   format STDOUT =
   @###   @.###   @##.###  @###   @###   ^####
    42,   3.1415,  undef,    0, 10000,   undef
   .
Output:
     42   3.142     0.000     0   ####</code></pre>

<h2 id="The-Field-@*-for-Variable-Width-Multi-Line-Text"><a class="permalink" href="perlform.html#The-Field-@*-for-Variable-Width-Multi-Line-Text">#</a><a id="The"></a><a id="The-Field-for-Variable-Width-Multi-Line-Text"></a>The Field @* for Variable-Width Multi-Line Text </h2>

<p>The field &quot;@*&quot; can be used for printing multi-line, nontruncated values; it should (but need not) appear by itself on a line. A final line feed is chomped off, but all other characters are emitted verbatim.</p>

<h2 id="The-Field-^*-for-Variable-Width-One-line-at-a-time-Text"><a class="permalink" href="perlform.html#The-Field-%5E*-for-Variable-Width-One-line-at-a-time-Text">#</a><a id="The1"></a><a id="The-Field-for-Variable-Width-One-line-at-a-time-Text"></a>The Field ^* for Variable-Width One-line-at-a-time Text </h2>

<p>Like &quot;@*&quot;, this is a variable-width field. The value supplied must be a scalar variable. Perl puts the first line (up to the first &quot;\n&quot;) of the text into the field, and then chops off the front of the string so that the next time the variable is referenced, more of the text can be printed. The variable will <i>not</i> be restored.</p>

<pre><code>Example:
   $text = &quot;line 1\nline 2\nline 3&quot;;
   format STDOUT =
   Text: ^*
         $text
   ~~    ^*
         $text
   .
Output:
   Text: line 1
         line 2
         line 3</code></pre>

<h2 id="Specifying-Values"><a class="permalink" href="perlform.html#Specifying-Values">#</a><a id="Specifying"></a>Specifying Values </h2>

<p>The values are specified on the following format line in the same order as the picture fields. The expressions providing the values must be separated by commas. They are all evaluated in a list context before the line is processed, so a single list expression could produce multiple list elements. The expressions may be spread out to more than one line if enclosed in braces. If so, the opening brace must be the first token on the first line. If an expression evaluates to a number with a decimal part, and if the corresponding picture specifies that the decimal part should appear in the output (that is, any picture except multiple &quot;#&quot; characters <b>without</b> an embedded &quot;.&quot;), the character used for the decimal point is determined by the current LC_NUMERIC locale if <code>use locale</code> is in effect. This means that, if, for example, the run-time environment happens to specify a German locale, &quot;,&quot; will be used instead of the default &quot;.&quot;. See <a href="perllocale.html">perllocale</a> and <a href="perlform.html#WARNINGS">&quot;WARNINGS&quot;</a> for more information.</p>

<h2 id="Using-Fill-Mode"><a class="permalink" href="perlform.html#Using-Fill-Mode">#</a><a id="Using"></a>Using Fill Mode </h2>

<p>On text fields the caret enables a kind of fill mode. Instead of an arbitrary expression, the value supplied must be a scalar variable that contains a text string. Perl puts the next portion of the text into the field, and then chops off the front of the string so that the next time the variable is referenced, more of the text can be printed. (Yes, this means that the variable itself is altered during execution of the write() call, and is not restored.) The next portion of text is determined by a crude line-breaking algorithm. You may use the carriage return character (<code>\r</code>) to force a line break. You can change which characters are legal to break on by changing the variable <code>$:</code> (that&#39;s $FORMAT_LINE_BREAK_CHARACTERS if you&#39;re using the English module) to a list of the desired characters.</p>

<p>Normally you would use a sequence of fields in a vertical stack associated with the same scalar variable to print out a block of text. You might wish to end the final field with the text &quot;...&quot;, which will appear in the output if the text was too long to appear in its entirety.</p>

<h2 id="Suppressing-Lines-Where-All-Fields-Are-Void"><a class="permalink" href="perlform.html#Suppressing-Lines-Where-All-Fields-Are-Void">#</a><a id="Suppressing"></a>Suppressing Lines Where All Fields Are Void </h2>

<p>Using caret fields can produce lines where all fields are blank. You can suppress such lines by putting a &quot;~&quot; (tilde) character anywhere in the line. The tilde will be translated to a space upon output.</p>

<h2 id="Repeating-Format-Lines"><a class="permalink" href="perlform.html#Repeating-Format-Lines">#</a><a id="Repeating"></a>Repeating Format Lines </h2>

<p>If you put two contiguous tilde characters &quot;~~&quot; anywhere into a line, the line will be repeated until all the fields on the line are exhausted, i.e. undefined. For special (caret) text fields this will occur sooner or later, but if you use a text field of the at variety, the expression you supply had better not give the same value every time forever! (<code>shift(@f)</code> is a simple example that would work.) Don&#39;t use a regular (at) numeric field in such lines, because it will never go blank.</p>

<h2 id="Top-of-Form-Processing"><a class="permalink" href="perlform.html#Top-of-Form-Processing">#</a><a id="Top"></a>Top of Form Processing   </h2>

<p>Top-of-form processing is by default handled by a format with the same name as the current filehandle with &quot;_TOP&quot; concatenated to it. It&#39;s triggered at the top of each page. See <a href="perlfunc.html#write">&quot;write&quot; in perlfunc</a>.</p>

<p>Examples:</p>

<pre><code># a report on the /etc/passwd file
format STDOUT_TOP =
                        Passwd File
Name                Login    Office   Uid   Gid Home
------------------------------------------------------------------
.
format STDOUT =
@&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; @||||||| @&lt;&lt;&lt;&lt;&lt;&lt;@&gt;&gt;&gt;&gt; @&gt;&gt;&gt;&gt; @&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
$name,              $login,  $office,$uid,$gid, $home
.


# a report from a bug report form
format STDOUT_TOP =
                        Bug Reports
@&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;     @|||         @&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
$system,                      $%,         $date
------------------------------------------------------------------
.
format STDOUT =
Subject: @&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
         $subject
Index: @&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; ^&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
       $index,                       $description
Priority: @&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; Date: @&lt;&lt;&lt;&lt;&lt;&lt;&lt; ^&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
          $priority,        $date,   $description
From: @&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; ^&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
      $from,                         $description
Assigned to: @&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; ^&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
             $programmer,            $description
~                                    ^&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
                                     $description
~                                    ^&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
                                     $description
~                                    ^&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
                                     $description
~                                    ^&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
                                     $description
~                                    ^&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;...
                                     $description
.</code></pre>

<p>It is possible to intermix print()s with write()s on the same output channel, but you&#39;ll have to handle <code>$-</code> (<code>$FORMAT_LINES_LEFT</code>) yourself.</p>

<h2 id="Format-Variables"><a class="permalink" href="perlform.html#Format-Variables">#</a><a id="Format"></a>Format Variables  </h2>

<p>The current format name is stored in the variable <code>$~</code> (<code>$FORMAT_NAME</code>), and the current top of form format name is in <code>$^</code> (<code>$FORMAT_TOP_NAME</code>). The current output page number is stored in <code>$%</code> (<code>$FORMAT_PAGE_NUMBER</code>), and the number of lines on the page is in <code>$=</code> (<code>$FORMAT_LINES_PER_PAGE</code>). Whether to autoflush output on this handle is stored in <code>$|</code> (<code>$OUTPUT_AUTOFLUSH</code>). The string output before each top of page (except the first) is stored in <code>$^L</code> (<code>$FORMAT_FORMFEED</code>). These variables are set on a per-filehandle basis, so you&#39;ll need to select() into a different one to affect them:</p>

<pre><code>    select((select(OUTF),
	    $~ = &quot;My_Other_Format&quot;,
	    $^ = &quot;My_Top_Format&quot;
	   )[0]);</code></pre>

<p>Pretty ugly, eh? It&#39;s a common idiom though, so don&#39;t be too surprised when you see it. You can at least use a temporary variable to hold the previous filehandle: (this is a much better approach in general, because not only does legibility improve, you now have an intermediary stage in the expression to single-step the debugger through):</p>

<pre><code>$ofh = select(OUTF);
$~ = &quot;My_Other_Format&quot;;
$^ = &quot;My_Top_Format&quot;;
select($ofh);</code></pre>

<p>If you use the English module, you can even read the variable names:</p>

<pre><code>use English;
$ofh = select(OUTF);
$FORMAT_NAME     = &quot;My_Other_Format&quot;;
$FORMAT_TOP_NAME = &quot;My_Top_Format&quot;;
select($ofh);</code></pre>

<p>But you still have those funny select()s. So just use the FileHandle module. Now, you can access these special variables using lowercase method names instead:</p>

<pre><code>use FileHandle;
format_name     OUTF &quot;My_Other_Format&quot;;
format_top_name OUTF &quot;My_Top_Format&quot;;</code></pre>

<p>Much better!</p>

<h1 id="NOTES"><a class="permalink" href="perlform.html#NOTES">#</a>NOTES</h1>

<p>Because the values line may contain arbitrary expressions (for at fields, not caret fields), you can farm out more sophisticated processing to other functions, like sprintf() or one of your own. For example:</p>

<pre><code>    format Ident =
	@&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
	&amp;commify($n)
    .</code></pre>

<p>To get a real at or caret into the field, do this:</p>

<pre><code class="plaintext">    format Ident =
    I have an @ here.
	    &quot;@&quot;
    .</code></pre>

<p>To center a whole line of text, do something like this:</p>

<pre><code class="plaintext">    format Ident =
    @|||||||||||||||||||||||||||||||||||||||||||||||
	    &quot;Some text line&quot;
    .</code></pre>

<p>There is no builtin way to say &quot;float this to the right hand side of the page, however wide it is.&quot; You have to specify where it goes. The truly desperate can generate their own format on the fly, based on the current number of columns, and then eval() it:</p>

<pre><code>$format  = &quot;format STDOUT = \n&quot;
         . &#39;^&#39; . &#39;&lt;&#39; x $cols . &quot;\n&quot;
         . &#39;$entry&#39; . &quot;\n&quot;
         . &quot;\t^&quot; . &quot;&lt;&quot; x ($cols-8) . &quot;~~\n&quot;
         . &#39;$entry&#39; . &quot;\n&quot;
         . &quot;.\n&quot;;
print $format if $Debugging;
eval $format;
die $@ if $@;</code></pre>

<p>Which would generate a format looking something like this:</p>

<pre><code>format STDOUT =
^&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
$entry
        ^&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;~~
$entry
.</code></pre>

<p>Here&#39;s a little program that&#39;s somewhat like fmt(1):</p>

<pre><code>format =
^&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; ~~
$_

.

$/ = &#39;&#39;;
while (&lt;&gt;) {
    s/\s*\n\s*/ /g;
    write;
}</code></pre>

<h2 id="Footers"><a class="permalink" href="perlform.html#Footers">#</a>Footers  </h2>

<p>While $FORMAT_TOP_NAME contains the name of the current header format, there is no corresponding mechanism to automatically do the same thing for a footer. Not knowing how big a format is going to be until you evaluate it is one of the major problems. It&#39;s on the TODO list.</p>

<p>Here&#39;s one strategy: If you have a fixed-size footer, you can get footers by checking $FORMAT_LINES_LEFT before each write() and print the footer yourself if necessary.</p>

<p>Here&#39;s another strategy: Open a pipe to yourself, using <code>open(MYSELF, &quot;|-&quot;)</code> (see <a href="perlfunc.html#open">&quot;open&quot; in perlfunc</a>) and always write() to MYSELF instead of STDOUT. Have your child process massage its STDIN to rearrange headers and footers however you like. Not very convenient, but doable.</p>

<h2 id="Accessing-Formatting-Internals"><a class="permalink" href="perlform.html#Accessing-Formatting-Internals">#</a><a id="Accessing"></a>Accessing Formatting Internals </h2>

<p>For low-level access to the formatting mechanism, you may use formline() and access <code>$^A</code> (the $ACCUMULATOR variable) directly.</p>

<p>For example:</p>

<pre><code>$str = formline &lt;&lt;&#39;END&#39;, 1,2,3;
@&lt;&lt;&lt;  @|||  @&gt;&gt;&gt;
END

print &quot;Wow, I just stored &#39;$^A&#39; in the accumulator!\n&quot;;</code></pre>

<p>Or to make an swrite() subroutine, which is to write() what sprintf() is to printf(), do this:</p>

<pre><code>    use Carp;
    sub swrite {
	croak &quot;usage: swrite PICTURE ARGS&quot; unless @_;
	my $format = shift;
	$^A = &quot;&quot;;
	formline($format,@_);
	return $^A;
    }

    $string = swrite(&lt;&lt;&#39;END&#39;, 1, 2, 3);
 Check me out
 @&lt;&lt;&lt;  @|||  @&gt;&gt;&gt;
 END
    print $string;</code></pre>

<h1 id="WARNINGS"><a class="permalink" href="perlform.html#WARNINGS">#</a>WARNINGS</h1>

<p>The lone dot that ends a format can also prematurely end a mail message passing through a misconfigured Internet mailer (and based on experience, such misconfiguration is the rule, not the exception). So when sending format code through mail, you should indent it so that the format-ending dot is not on the left margin; this will prevent SMTP cutoff.</p>

<p>Lexical variables (declared with &quot;my&quot;) are not visible within a format unless the format is declared within the scope of the lexical variable.</p>

<p>If a program&#39;s environment specifies an LC_NUMERIC locale and <code>use locale</code> is in effect when the format is declared, the locale is used to specify the decimal point character in formatted output. Formatted output cannot be controlled by <code>use locale</code> at the time when write() is called. See <a href="perllocale.html">perllocale</a> for further discussion of locale handling.</p>

<p>Within strings that are to be displayed in a fixed-length text field, each control character is substituted by a space. (But remember the special meaning of <code>\r</code> when using fill mode.) This is done to avoid misalignment when control characters &quot;disappear&quot; on some output media.</p>


      </div>
      <div id="footer">
        <p>Perldoc Browser is maintained by Dan Book (<a href="https://metacpan.org/author/DBOOK">DBOOK</a>). Please contact him via the <a href="https://github.com/Grinnz/perldoc-browser/issues">GitHub issue tracker</a> or <a href="mailto:dbook@cpan.org">email</a> regarding any issues with the site itself, search, or rendering of documentation.</p>

<p>The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via the <a href="https://github.com/Perl/perl5/issues">Perl issue tracker</a>, the <a href="https://lists.perl.org/list/perl5-porters.html">mailing list</a>, or <a href="https://kiwiirc.com/client/irc.perl.org/p5p">IRC</a> to report any issues with the contents or format of the documentation.</p>


      </div>
    </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.slim.min.js" integrity="sha512-/DXTXr6nQodMUiq+IUJYCt2PPOUjrHJ9wFrqpJ3XkgPNOZVfMok7cRw6CSxyCQxXn6ozlESsSh1/sMCTF1rL/g==" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js" integrity="sha512-ubuT8Z88WxezgSqf3RLuNi5lmjstiJcyezx34yIU2gAHonIi27Na7atqzUZCOoY4CExaoFumzOsFQ2Ch+I/HCw==" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
    <script src="../highlight.pack.js"></script>
    <script>hljs.highlightAll();</script>
  </body>
</html>
